#!/usr/bin/env python
# encoding: utf-8
"""
admin.py

Created by Bertrand Cachet on 2010-01-12.
Copyright (c) 2010 __MyCompanyName__. All rights reserved.
"""

from django.contrib import admin
from cassebras.contest.models import Competitor, Slope, \
                                     Category, SuccessfullClimb

class CompetitorAdmin(admin.ModelAdmin):
    """
    How to render Competitor model in the Admin application
    """
    fields = ['name', 'surname', 'category', 'number']
    search_fields = ['name', 'surname', 'number']
    list_display = ('number', 'surname', 'name', 'score')
    
class SlopeAdmin(admin.ModelAdmin):
    """
    How to render Slope model in the Admin application
    """
    fields = ['name']
    list_display = ('name', 'score')
    #inlines = [CompetitorInline]

admin.site.register(Category)
admin.site.register(Slope, SlopeAdmin)
admin.site.register(SuccessfullClimb)
admin.site.register(Competitor, CompetitorAdmin)
